﻿using System;
using System.Globalization;

namespace Microsoft.International
{

    /// <summary>
    /// The FormatCulture class is used in place of the CultureInfo class to override the formatter.
    /// </summary>
    public class FormatCultureInfo : CultureInfo
    {

        /// <summary>
        /// Initializes a new instance of the System.Globalization.FormatCultureInfo class based on the culture specified by name.
        /// </summary>
        /// <param name="name">
        /// Type: System.String
        /// A predefined System.Globalization.CultureInfo name, Name of an existing System.Globalization.CultureInfo, or Windows-only culture name.
        /// </param>
        public FormatCultureInfo(String name)
            : base(name)
        {

        }

        /// <summary>
        /// Gets an object that defines how to format the specified type.
        /// </summary>
        /// <param name="formatType">
        /// Type: System.Type
        /// The Type for which to get a formatting object.
        /// This method only supports the System.Globalization.NumberFormatInfo and System.Globalization.DateTimeFormatInfo types.
        /// </param>
        /// <returns>
        /// Type: System.Object
        /// The value of the System.Globalization.NumberFormat property, which is a System.Globalization.NumberFormatInfo containing the default number format information for the current System.Globalization.CultureInfo, if formatType is the System.Type object for the System.Globalization.NumberFormatInfo class.
        /// -or- 
        /// The value of the System.Globalization.DateTimeFormat property, which is a System.Globalization.DateTimeFormatInfo containing the default date and time format information for the current System.Globalization.CultureInfo, if formatType is the System.Type object for the System.Globalization.DateTimeFormatInfo class.
        /// -or- 
        /// null, if formatType is any other object.
        /// </returns>
        public override Object GetFormat(Type formatType)
        {
            // Return a Microsoft.International.EuropeNumericFormatter with the specified culture.
            return new EuropeNumericFormatter();
        }

    }

}